import './App.css';
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import { ConfigProvider } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import MainLayout from './layouts/MainLayout';
import WorkData from './pages/workData';
import WorkCount from './pages/workCount';
import WorkDetail from './pages/workDetail';
import VehicleList from './pages/vehicleList';
import DriverList from './pages/driverList';
import VehicleLocation from './pages/vehicleLocation';
import VehicleTeam from './pages/vehicleTeam';
import Login from './pages/Login';

import ProtectedRoute from './components/ProtectedRoute';
import PublicRoute from './components/PublicRoute';

function App() {
  return (
    <ConfigProvider locale={zhCN}>
      <Router>
        <Routes>
          <Route path="/user/login" element={
            <PublicRoute>
              <Login />
            </PublicRoute>
          } />
          <Route path="/" element={<MainLayout />}>
            <Route index element={
              <ProtectedRoute>
                {/* <Dashboard /> */}
                <WorkData />
              </ProtectedRoute>
            } />
            {/* <Route path="/dashboard/analysis" element={
              <ProtectedRoute>
                <Dashboard />
              </ProtectedRoute>
            } /> */}
            <Route path="/workData" element={
              <ProtectedRoute>
                <WorkData />
              </ProtectedRoute>
            } />
            <Route path="/workCount" element={
              <ProtectedRoute>
                <WorkCount />
              </ProtectedRoute>
            } />
            <Route path="/workDetail" element={
              <ProtectedRoute>
                <WorkDetail />
              </ProtectedRoute>
            } />
            <Route path="/vehicleList" element={
              <ProtectedRoute>
                <VehicleList />
              </ProtectedRoute>
            } />
            <Route path="/driverList" element={
              <ProtectedRoute>
                <DriverList />
              </ProtectedRoute>
            } />
            <Route path="/vehicleLocation" element={
              <ProtectedRoute>
                <VehicleLocation />
              </ProtectedRoute>
            } />
            <Route path="/vehicleTeam" element={
              <ProtectedRoute>
                <VehicleTeam />
              </ProtectedRoute>
            } />
          </Route>
        </Routes>
      </Router>
    </ConfigProvider>
  );
}

export default App;